Program Premier-liga;
Var B: array[1..16] of integer;
	Team: array[1..16] of string	
	MaxB,MinB,Nmax,Nmin,I: integer,
Begin
{      }
       Writeln(      )
	For I:=1 to 16 do
	Begin
		Write(I, : ); Readln(Team[I]);
       Write(: ); Readln(B[I])
	End;
{       }
MaxB:=B[1]; Nmax:=1; MinB:=B[1]; Nmin:=1;
For I:=2 to 16 do
       Begin
       { }
       If B[I]>MaxB then
    Begin MaxB:=B[I];
    	Nmax:=I
    End;
	{ }
    If B[I]<MinB then
    Begin MinB:=B[I];
	Nmin:=I
    End
End;
{ }
Writeln(-  , Team[Nmax],  , MaxB, );
Writeln(  ,Team[Nmin], c ,MinB,)
End.
